<template>
	<view class="callection">
		<u-navbar title="收款设置" @rightClick="rightClick" :autoBack="true" rightText="添加账户">
		</u-navbar>
		<view class="" style="height: 150rpx;">

		</view>
		<view class="tiontype">
			<view class="typeLeft">
				<image src="../../static/image/pay.png" mode="" style="width: 66rpx;height: 66rpx;"></image>
				<view class="text">
					<view class="">
						支付宝
					</view>
					<view class="">
						（{{pageData.alipay_account}}）
					</view>
				</view>
			</view>

			<image src="../../static/image/right.png" mode="" style="width: 12rpx;height: 28rpx;"></image>
		</view>

		<u-popup :show="show" mode="bottom" @close="show = false" bgColor="transparent">
			<view class="content">
				<view class="contentItem" @click="handlewxnum">
					<view class="itemleft">
						<image src="../../static/image/wx.png" mode="" style="width: 62rpx; height: 62rpx;"></image>
						<view class="" style="margin-left: 44rpx;">
							添加微信账户
						</view>
					</view>
					<image src="../../static/image/right.png" mode="" style="width: 18rpx;height: 28rpx;"></image>
				</view>
				<view class="heng">
					
				</view>
				<view class="contentItem" style="border-radius: 0rpx;" @click="handleZfb">
					<view class="itemleft">
						<image src="../../static/image/pay.png" mode="" style="width: 62rpx; height: 62rpx;"></image>
						<view class="" style="margin-left: 44rpx;">
							添加支付宝账户
						</view>
					</view>
					<image src="../../static/image/right.png" mode="" style="width: 18rpx;height: 28rpx;"></image>
				</view>
				
				<view class="colse" @click="show = false">
					取消
				</view>
			</view>
		</u-popup>
 
	</view> 
</template>

<script>
	import {
		userinfo,
	} from "@/api/api.js"
	export default {
		data() {
			return {
				show: false,
				pageData:{},
			}
		},
		onLoad() {
			if (!uni.getStorageSync("token")) {
				uni.reLaunch({
					url: "../login/index"
				})
				return
			}
		},
		onShow() {
			this.handleGetuserinfo()
		},
		methods: {
			async handleGetuserinfo() {
				let res = await userinfo()
				this.pageData = res.data
			
				this.pageData.alipay_account = this.pageData.alipay_account.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
				console.log("用户信息", res)
			},
			handlewxnum(){
				uni.navigateTo({
					url:"./wxNmuber"
				})
			},
			handleZfb(){
				uni.navigateTo({
					url:"./zfbNumber"
				})
			},
			rightClick() {
				console.log("55555555")
				this.show = true
			},
		}
	}
</script>

<style scoped lang="scss">
	.content{
		width: 100%;
		height: 276rpx;
		// background: rgba(0,0,0,0.3);
		// padding: 20rpx 0;
		// box-sizing: border-box;
		border-radius: 20rpx 20rpx 0rpx 0rpx;
		position: relative;
		.contentItem{
			width: 100%;
			height: 90rpx;
			background-color: #ffffff;
			display: flex;
			padding: 0 30rpx;
			box-sizing: border-box;
			align-items: center;
			justify-content: space-between;
			font-size: 36rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 400;
			color: #707070;
			line-height: 40rpx;
			border-radius: 20rpx 20rpx 0rpx 0rpx;
			.itemleft{
				display: flex;
				align-items: center;
			}
		}
		.heng{
			width: 690rpx;
			height: 1rpx;
			background-color: #CACACA;
			margin: 0 auto;
		}
		.colse{
			width: 100%;
			height: 86rpx;
			background: #FFFFFF;
			font-size: 36rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: 400;
			color: #707070;
			line-height: 86rpx;
			text-align: center;
			position: absolute;
			bottom: 0;
		}
	}
	.tiontype {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;
		height: 88rpx;
		background: #FFFFFF;

		.typeLeft {
			display: flex;
			align-items: center;
			font-size: 30rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: 400;
			color: #333333;

			.text {
				display: flex;
				margin-left: 44rpx;
			}
		}
	}
</style>